package com.tongji.seller.utils
{		
	import com.tongji.seller.view.popup.AddImageTitleWindow;
	import com.tongji.seller.view.popup.BrightTitleWindow;
	import com.tongji.seller.view.popup.ChangeFurnitureTitleWindow;
	import com.tongji.seller.view.popup.FilterTitleWindow;
	import com.tongji.seller.view.popup.SaveLoadingTitleWindow;
	import com.tongji.seller.view.popup.SavedSceneTitleWindow;
	
	import flash.display.DisplayObject;
	
	import mx.core.IFlexDisplayObject;
	import mx.managers.PopUpManager;
	import mx.skins.halo.PopUpIcon;
	
	import org.robotlegs.core.IMediatorMap;

	/**
	 * 
	 * @author caddy
	 * 
	 */	
	public class PopUpAdmin
	{
		public static const MY_SCENE_TITLE_WIN:String = "mySceneTitleWin";
		public static const FILTER_TITLE_WIN:String = "filterTitleWin";
		public static const ADD_IMAGE_TITLE_WIN:String = "addImageTitleWin";
		public static const CHANGE_PRODUCT_TITLE_WIN:String = "changeProductTitleWin";
		public static const BRIGHT_TITLE_WIN:String = "brightTitleWin";
		public static const SAVE_LOADING_TITLE_WIN:String = "saveLoadingTitleWin";

		public static function popupCenterWindow(type:String, view:DisplayObject, mediatorMap:IMediatorMap, model:Boolean = true, name:String = null):void
		{
			var window:IFlexDisplayObject;
			
			switch (type)
			{
				case MY_SCENE_TITLE_WIN:
					window = new SavedSceneTitleWindow();
					break;	
				case FILTER_TITLE_WIN:
					window = new FilterTitleWindow();
					break;
				case ADD_IMAGE_TITLE_WIN:
					window = new AddImageTitleWindow();
					break;
				case CHANGE_PRODUCT_TITLE_WIN:
					window = new ChangeFurnitureTitleWindow();
					break;
				case BRIGHT_TITLE_WIN:
					window = new BrightTitleWindow();
					break;
				case SAVE_LOADING_TITLE_WIN:
					window = new SaveLoadingTitleWindow();
					break;
			}
			
			PopUpManager.addPopUp(window, view, model);
			
			window.x = (int)(view.stage.stageWidth / 2 - window.width / 2);
			window.y = (int)(view.stage.stageHeight / 2 - window.height / 2);
			mediatorMap.createMediator(window);
		}
		
	}
}